<?php include_once('includes/header.php'); ?>
<?php if(!isset($_POST['words'])):?>
	<?php include_once(inc('403.php')); ?>
<?php else: ?>
<div id="main">
	<span class="panel_title"><?php _("添加单词"); ?>
	<span class="tips"><?php _('(请在每个单词后填写对应的中文翻译)')?></span>
	</span>

	<div id="add_words" class="content">
		<?php
			$str=$_POST['words'];
			$words=json_decode($str);

			$idx=1;
			foreach ($words as $word):
				$idx++;
		?>
			<div class="word_and_definition">
				<input type="text" class="word_input text_input_simple azul_forte" value="<?php e($word)?>" id="<?php e('word_'.$idx)?>">
				<span class="colon">:</span>
				<input type="text" class="definition_input text_input_simple" id="<?php e('definition_'.$idx)?>"/>
			</div>
		<?php endforeach ?>
			<div class="notice hidden">
				<?php _('表单不完整，我们已经将问题标注了出来，请检查后再提交。'); ?>
			</div>
			<div class="response"></div>
			<div class="help">
				<?php _('添加单词定义到系统词库，帮助'.VOCA.'完善词库。'); ?>
			</div>
	</div>
	<div class="panel_footer">
		<input type="button" class="btn" value="添加单词" id="btn_add_words"/>
	</div>
</div>
<?php endif ?>
<?php get_footer(); ?>